package com.huqing.icu.enums;

import org.apache.commons.lang.StringUtils;

public enum DeviceTypeConstants {

    /**
     *
     */
    ALL(0),
    IOS(1),
    ANDROID(2),

    //3-小程序
    WX(3),
    ;

    private int code;

    public static Integer getOsCode(String osName) {
        if (StringUtils.isNotBlank(osName)) {
            if ("ANDROID".equals(osName.toUpperCase())) {
                return DeviceTypeConstants.ANDROID.getCode();
            }
            if ("IOS".equals(osName.toUpperCase())) {
                return DeviceTypeConstants.IOS.getCode();
            }
        }
        return null;
    }

    private DeviceTypeConstants(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

}
